1 ' (PC)^3 Software Submission MAKSTKFL authored on January 4, 1983 by
2 '
3 ' Michael Csontos, 3228 Livonia Center Road, Lima, New York 14485
4 '
5 ' Copyright 1983 Michael Csontos
6 '
7 '  This program is made freely available non-exclusively to the Picture
8 '  City Personal Computer Programmers' Club for distribution to its members
9 '  and through software exchange to other users groups as long as credit is
10 ' given to the author and (PC)^3.
11 '
12 '
13 ' NOTE: The files MAKSTKFL.DOC, UPDSTKFL.DAT, and data files with the
14 ' extensions DJA, NYS, OTC, OPT, and MUT are associated with this program.
15 '
16 '
10000 DEFINT N:DIM GRAPH$(100)
10050 KEY OFF:CLS
10100 LIN=CSRLIN:LOCATE 25,1:COLOR 0,7:PRINT STRING$(79," ");:COLOR 7,0:LOCATE LIN,1
10150 ON ERROR GOTO 10200:OPEN "makstkfl.doc" FOR INPUT AS #1:CLOSE #1:GOTO 10250
10200 NODOC=1:RESUME 10250
10250 ON ERROR GOTO 0
10300 ON ERROR GOTO 10350:OPEN "updstkfl.dat" FOR INPUT AS #1:CLOSE #1:GOTO 10400
10350 NOUPD=1:RESUME 10400
10400 ON ERROR GOTO 0
10450 RESPMSG$="PRESS A NUMBER KEY CORRESPONDING TO YOUR SELECTION OR PRESS <Esc> TO QUIT."
10500 PRINT
10550 PRINT "Do you want to (1): insert data ahead of an existing file (earlier dates),
10600 PRINT " or            (2): add data to an existing file (starting after last date),
10650 PRINT " or            (3): start a new securities data file,"
10700 PRINT " or            (4): find start and end dates for a file,"
10750 PRINT " or            (5): print a report of a securities file,
10800 PRINT " or            (6): plot a graph on the screen of the last 24 day's price data,
10850 IF NOUPD THEN 11000
10900 PRINT " or            (7): update all files listed in UPDSTKFL with next day's data,
10950 IF NODOC THEN 11050
11000 PRINT " or            (8): read the documentation file,
11050 PRINT " or            <Esc>: to quit?"
11100 X$=INKEY$:IF X$="" THEN 11100 ELSE IF X$=CHR$(27) THEN 18300 ELSE B=VAL(X$)
11150 IF B<1 OR B>8 THEN PRINT:PRINT RESPMSG$:GOTO 11100
11200 ON B GOTO 11250,11300,11350,11400,11450,11500,11550,11600
11250 B$="INSERT DATA":GOTO 11650
11300 B$="ADD DATA":GOTO 11650
11350 B$="NEW DATA":GOTO 11650
11400 B$="DATE RANGE":GOTO 11650
11450 B$="REPORT":GOTO 11650
11500 B$="SCREEN GRAPH":GOTO 11650
11550 B$="UPDATE":GOTO 11650
11600 B$="DOCUMENTATION":GOTO 11650
11650 LIN=CSRLIN:LOCATE 25,1:COLOR 0,7:PRINT B$;:COLOR 7,0:LOCATE LIN,1
11700 ON B GOTO 11750,11750,11750,11750,11750,11750,26950,27950
11750 PRINT
11800 PRINT "Is the file for (1): Dow Jones Averages,
11850 PRINT " or             (2): New York Stock Exchange,
11900 PRINT " or             (3): Over the Counter Markets,
11950 PRINT " or             (4): Options,
12000 PRINT " or             (5): Mutual Funds,
12050 PRINT " or             <Esc>: to quit?"
12100 X$=INKEY$:IF X$="" THEN 12100 ELSE IF X$=CHR$(27) THEN 18300 ELSE C=VAL(X$)
12150 IF C<1 OR C>5 THEN PRINT:PRINT RESPMSG$:GOTO 12100
12200 ON C GOTO 12250,12300,12350,12400,12450
12250 EXT$=".DJA":GOTO 12500
12300 EXT$=".NYS":GOTO 12500
12350 EXT$=".OTC":GOTO 12500
12400 EXT$=".OPT":GOTO 12500
12450 EXT$=".MUT":GOTO 12500
12500 LIN=CSRLIN:LOCATE 25,15:COLOR 0,7:PRINT "FILE FOR " EXT$;:COLOR 7,0:LOCATE LIN,1
12550 GOSUB 22050'getfile
12600 ON B GOTO 13200,13800,14300,12700,24200,28600,12650,12650
12650 PRINT "B>6 trap #1":GOTO 13350
12700 IF NOFILE=1 THEN 13350
12750 INPUT #1, STARTDATE$
12800 FOR N=1 TO 4: INPUT #1, DUMP:NEXT N
12850 IF EOF(1) THEN 13050
12900 INPUT #1, ENDDATE$
12950 FOR N=1 TO 4: INPUT #1, DUMP:NEXT N
13000 GOTO 12850
13050 PRINT:PRINT "The first date in the file is " STARTDATE$ ","
13100 PRINT:PRINT "and the final file date is    " ENDDATE$ "."
13150 GOTO 13350
13200 IF NOFILE=1 THEN PRINT:PRINT "You cannot insert unless there is already a file on the disk.  Run the" ELSE 13400
13250 PRINT "program again making the correct selections or correct the problem with your
13300 PRINT "disk files.
13350 CLOSE:KEY ON:END
13400 INPUT#1,FIRSTDATE$
13450 CLOSE #1
13500 TEMPFILE$=FILENAME$+".OLD"
13550 PRINT:PRINT "GENERATING BACKUP FILE CALLED " TEMPFILE$ "."
13600 ON ERROR GOTO 13750:NAME FILESPEC$ AS TEMPFILE$:ON ERROR GOTO 0
13650 LIN=CSRLIN:LOCATE 25,64:COLOR 0,7:PRINT "TILL " FIRSTDATE$;:COLOR 7,0:LOCATE LIN,1
13700 GOTO 14600
13750 IF ERR=58 THEN KILL TEMPFILE$:RESUME ELSE ON ERROR GOTO 0:GOTO 13350
13800 IF NOFILE=1 THEN PRINT:PRINT "You cannot add to a file unless there is already a file on the disk.  Run the" ELSE 14000
13850 PRINT "program again making the correct selections or correct the problem with your
13900 PRINT "disk files.
13950 CLOSE:KEY ON:END
14000 IF EOF(1) THEN CLOSE #1:GOTO 14700
14050 INPUT #1,DAT$
14100 FOR N=1 TO 4
14150 INPUT #1,DUMP
14200 NEXT N
14250 GOTO 14000
14300 CLOSE #1
14350 PRINT:PRINT "To start a securities data file, enter a file name (up to eight characters, no
14400 PRINT "extension. The extension shown below will be added to identify the file.
14450 IF C=4 THEN PRINT:PRINT "NOTE: To work with the program PLTSTKFL, the last two characters of an options        data filename must be the strike price of the option.
14500 PRINT:INPUT "FILENAME"; FILENAME$
14550 GOSUB 22350 'getfile name test
14600 PRINT:PRINT "Enter starting ";
14650 GOSUB 23700' datcheck
14700 DAYSKIP$(1)="SAT.":DAYSKIP$(2)="SUN."
14750 GOSUB 19500'dattonum
14800 GOSUB 22900'makefile
14850 LIN=CSRLIN:LOCATE 25,24:COLOR 0,7:PRINT FILESPEC$;:COLOR 7,0:LOCATE LIN,1
14900 LIN=CSRLIN:LOCATE 25,39:COLOR 0,7:PRINT "EX-9's; SK-8's; RP-7's";:COLOR 7,0:LOCATE LIN,1
14950 IF B=7 THEN 15300
15000 IF B=2 THEN 15100
15050 D=D-1
15100 PRINT:PRINT "To end entries, enter 9999."
15150 PRINT "To skip a date (holiday) enter 8888."
15200 PRINT "To repeat a date (error recovery) enter 7777."
15250 PRINT "If there is no data for an entry (no trades) press <enter> to skip through.":PRINT
15300 D=D+1
15350 GOSUB 20450'datgen
15400 IF DATINC=1 THEN GOSUB 20950: GOSUB 20450
15450 IF B=1 AND ATE$=FIRSTDATE$ THEN PRINT "START OF OLD DATA!":PRINT:PRINT "...Old data is being transferred from " TEMPFILE$ " to " FILESPEC$ ".":GOTO 18350
15500 GOSUB 21350'monthnam
15550 GOSUB 19850'dayname
15600 FOR WKDY=1 TO 7:IF DAYNAME$=DAYSKIP$(WKDY) THEN 15300
15650 NEXT WKDY
15700 PRINT  DAYNAME$ ", " MONTHNAME$ " " D$ ", " Y$
15750 ON C GOTO 16350,15800,16900,17350,17700
15800 INPUT "VOLUME"; AA' -----------NYS - C=2--------------------------------
15850 GOSUB 18100:IF INT(AA)<>AA THEN BEEP:PRINT "VOLUME must be an integer!":GOTO 15800
15900 INPUT "HIGH  "; BB
15950 GOSUB 18100
16000 INPUT "LOW   "; CC
16050 GOSUB 18100:IF CC>BB THEN BEEP:PRINT "LOW is greater than HIGH!":GOTO 16000
16100 IF (CC-BB)>.25*BB THEN BEEP:PRINT "Day's trading range is greater than 25%!"
16150 INPUT "CLOSE "; DD
16200 GOSUB 18100:IF DD>BB THEN BEEP:PRINT "CLOSE is greater than HIGH!":GOTO 16150
16250 IF DD<CC THEN BEEP:PRINT "CLOSE is less than LOW!":GOTO 16150
16300 GOTO 18050
16350 INPUT "CLOSE "; DD' -----------DJA - C=1--------------------------------
16400 GOSUB 18100
16450 INPUT "HIGH  "; BB
16500 GOSUB 18100:IF DD>BB THEN BEEP:PRINT "CLOSE is greater than HIGH!":GOTO 16450
16550 INPUT "LOW   "; CC
16600 GOSUB 18100:IF CC>BB THEN BEEP:PRINT "LOW is greater than HIGH!":GOTO 16550
16650 IF CC>DD THEN BEEP:PRINT "LOW is greater than CLOSE!":GOTO 16550
16700 IF (BB-CC)>.25*CC THEN BEEP:PRINT "Day's trading range is greater than 25%!"
16750 INPUT "VOLUME"; AA
16800 GOSUB 18100:IF INT(AA)<>AA THEN BEEP:PRINT "VOLUME must be an integer!":GOTO 16750
16850 GOTO 18050
16900 INPUT "VOLUME"; AA' -----------OTC - C=3--------------------------------
16950 GOSUB 18100:IF INT(AA)<>AA THEN BEEP:PRINT "VOLUME must be an integer!":GOTO 16900
17000 INPUT "BID   "; BB
17050 GOSUB 18100
17100 INPUT "ASKED "; CC
17150 GOSUB 18100:IF BB>CC THEN BEEP:PRINT "BID is greater than ASKED!":GOTO 17100
17200 IF (CC-BB)>.25*BB THEN BEEP:PRINT "Day's trading range is greater than 25%! Press <enter> to input this value, or    press any other key to reenter day's price data.":GOTO 17300
17250 GOTO 18050
17300 X$=INKEY$: IF X$="" THEN 17300 ELSE IF X$=CHR$(13) THEN 17250 ELSE 17000
17350 INPUT "CLOSE "; DD' ----------OPT - C=4---------------------------------
17400 GOSUB 18100
17450 INPUT "CALL  "; BB
17500 GOSUB 18100
17550 INPUT "PUT   "; CC
17600 GOSUB 18100
17650 GOTO 18050
17700 INPUT "NET ASSET VALUE"; BB' ----MUT - C=5------------------------------
17750 GOSUB 18100
17800 INPUT "OFFER          "; CC
17850 GOSUB 18100:IF BB>CC THEN BEEP:PRINT "NAV is greater than OFFER!":GOTO 17800
17900 IF (CC-BB)>.25*BB THEN BEEP:PRINT "Day's trading range is greater than 25%! Press <enter> to input this value, or    press any other key to reenter day's data.":GOTO 18000
17950 GOTO 18050
18000 X$=INKEY$: IF X$="" THEN 18000 ELSE IF X$=CHR$(13) THEN 17950 ELSE 17700
18050 WRITE#1,ATE$,AA,BB,CC,DD:IF B=7 THEN CLOSE #1:GOTO 27000 ELSE 15300
18100 IF AA=9999 OR BB=9999 OR CC=9999 OR DD=9999 THEN AA=0:BB=0:CC=0:DD=0:RETURN 18300
18150 IF AA=8888 OR BB=8888 OR CC=8888 OR DD=8888 THEN AA=0:BB=0:CC=0:DD=0:RETURN 15300
18200 IF AA=7777 OR BB=7777 OR CC=7777 OR DD=7777 THEN AA=0:BB=0:CC=0:DD=0:RETURN 15700
18250 RETURN
18300 CLOSE:KEY ON:END
18350 ON ERROR GOTO 18850
18400 OPEN TEMPFILE$ FOR INPUT AS #2
18450 IF EOF(2) THEN 19300
18500 INPUT #2, DAT$
18550 Z100$=DATE$
18600 DATE$=DAT$
18650 DAT$=DATE$:DATE$=Z100$
18700 INPUT #2,AA,BB,CC,DD
18750 WRITE #1,DAT$,AA,BB,CC,DD
18800 GOTO 18450
18850 IF ERL=18350 THEN 23050
18900 IF ERL=18550 THEN PRINT:PRINT "THERE IS AN ERROR IN READING THE FILE " TEMPFILE$ ". CHECK THIS FILE WITH EDLIN." ELSE 19100
18950 PRINT "  THIS PROGRAM WILL END WITH YOUR NEW DATA IN " FILESPEC$ " AND YOUR OLD FILE "
19000 PRINT "  IN " TEMPFILE$ "."
19050 CLOSE #1, #2: KEY ON:ON ERROR GOTO 0:END
19100 IF ERL=17000 THEN PRINT:PRINT "THERE IS AN ERROR IN READING FROM " TEMPFILE ". YOUR NEW DATA WITH SOME OF THE" ELSE 19300
19150 PRINT "OLD DATA APPENDED WILL BE FOUND IN " FILESPEC$ ".  YOUR OLD FILE " TEMPFILE$
19200 PRINT "SHOULD BE INTACT. USE EDLIN TO CHECK IT, THEN RENAME IT AND START OVER."
19250 CLOSE #1, #2: KEY ON:ON ERROR GOTO 0:END
19300 PRINT:PRINT "YOUR NEW DATA WITH THE OLD DATA APPENDED WILL BE FOUND IN " FILESPEC$
19350 PRINT:PRINT "CHECK THIS FILE WITH EDLIN. THE FILE " TEMPFILE$ " WILL BE WRITTEN OVER "
19400 PRINT:PRINT "ONLY WHEN YOU DO ANOTHER INSERT OPERATION ON " FILENAME$ "."
19450 CLOSE #1, #2: KEY ON:ON ERROR GOTO 0:END
19500 Y=VAL(RIGHT$(DAT$,4))'                        --
19550 D=VAL(MID$(DAT$,4,2))'   dat$ as mm-dd-yyyy     |  subroutine
19600 M=VAL(LEFT$(DAT$, 2))'    to  M,D,Y,M$,D$,Y$    |     to
19650 M2030=M+100:D2030=D+100'                        |  decompose
19700 M$=STR$(M2030):D$=STR$(D2030):Y$=STR$(Y)'       |    dates
19750 M$=RIGHT$(M$,2):D$=RIGHT$(D$,2):Y$=RIGHT$(Y$,4)'|    into
19800 RETURN'                                       --  strings & numbers
19850 M3000=M:Y3000=Y'
19900 IF M3000>2 THEN 20000'
19950 M3000=M3000+12:Y3000=Y3000-1'
20000 N=2+D+M3000*2+Y3000+INT(Y3000/4)-INT(Y3000/100)+INT(Y3000/400)+INT(.6*(M3000+1))'
20050 ON 1+INT(1/2+(N/7-INT(N/7))*7) GOTO 20100,20150,20200,20250,20300,20350,20400'
20100 DAYNAME$="SAT.":RETURN'
20150 DAYNAME$="SUN.":RETURN'         Subroutine to give day of week
20200 DAYNAME$="MON.":RETURN'
20250 DAYNAME$="TUE.":RETURN'                     from
20300 DAYNAME$="WED.":RETURN'
20350 DAYNAME$="THU.":RETURN'            integers M, D, & Y.
20400 DAYNAME$="FRI.":RETURN'
20450 DATINC=0:Z4000$=DATE$'                                  --
20500 M$=STR$(M+100):D$=STR$(D+100):Y$=STR$(Y+10000)'           | subroutine
20550 M$=RIGHT$(M$,2):D$=RIGHT$(D$,2):Y$=RIGHT$(Y$,4)'          |    to
20600 ATE$=M$+"-"+D$+"-"+Y$'                                    |   form
20650 ON ERROR GOTO 20850'   Converts M,D, & Y integers          |    and
20700 DATE$=ATE$'           into ATE$ in form mm-dd-yyyy        |   check
20750 ON ERROR GOTO 0'      and M$,D$, & Y$ as mm, dd, & yyyy.  |     a
20800 DATE$=Z4000$:RETURN'  If invalid date, returns DATINC = 1.| standard
20850 IF ERR=5 THEN DATINC=1 ELSE PRINT "DATGEN TROUBLE":STOP'  |date format
20900 RESUME 20750'                                            --
20950 D=1:M=M+1:YEARLIM=0'                                 --
21000 IF M=13 THEN 21100'     Uses M, D, & Y.                 | subroutine
21050 RETURN'                Assumes end of old month.       |    for
21100 M=1:Y=Y+1'             Returns D=1,M+1,Y+1 as needed.  | incrementing
21150 IF Y>=2099 THEN 21250'  If Y exceeds 2099,              |    a
21200 RETURN'                      returns: YEARLIM = 1      |   date
21250 PRINT "Cannot go beyond year 2099"'                    |    by
21300 YEARLIM=1:RETURN'                                    --   one month
21350 ON M GOTO 21400,21450,21500,21550,21600,21650,21700,21750,21800,21850,21900,21950
21400 MONTHNAME$="JAN.":RETURN'
21450 MONTHNAME$="FEB.":RETURN'
21500 MONTHNAME$="MAR.":RETURN'
21550 MONTHNAME$="APR.":RETURN'            Subroutine that returns
21600 MONTHNAME$="MAY.":RETURN'
21650 MONTHNAME$="JUN.":RETURN'                   a name for
21700 MONTHNAME$="JUL.":RETURN'
21750 MONTHNAME$="AUG.":RETURN'               the month numbered M.
21800 MONTHNAME$="SEP.":RETURN'
21850 MONTHNAME$="0CT.":RETURN'
21900 MONTHNAME$="NOV.":RETURN'
21950 MONTHNAME$="DEC.":RETURN'
22000 '-----------GETFILE------subroutine to specify a file for use----------
22050 ON ERROR GOTO 22550:NOFILE=0
22100 PRINT:PRINT "The following files are on the disk.":FILES "*"+EXT$
22150 ON ERROR GOTO 0
22200 IF B=3 THEN  RETURN 14500
22250 PRINT:PRINT "What is the filename of the one you want to use":INPUT "(if none type NONE)";FILENAME$
22300 IF FILENAME$="NONE" OR FILENAME$="none" OR FILENAME$="None" THEN NOFILE=1:RETURN
22350 FILESPEC$=FILENAME$+EXT$
22400 ON ERROR GOTO 22650:OPEN FILESPEC$ FOR INPUT AS #1
22450 IF B=3 THEN PRINT "There already is a file with this name on the disk. Entering data will change   it.  Press <Ctrl>+<Break> now to quit if this is a mistake.":CLOSE #1
22500 ON ERROR GOTO 0:RETURN
22550 IF ERR=53 THEN 22600 ELSE PRINT "GETFILE TROUBLE":STOP
22600 PRINT "There are no files for this security on this disk.":NOFILE=1:RESUME 22500
22650 IF ERR = 52 THEN PRINT "That is not a correct filespec, try again":RESUME 22150
22700 IF ERR = 62 THEN PRINT "Bad file data. You are trying to read from the wrong file. Try again.":RESUME 22050
22750 IF ERR = 53 THEN 22800 ELSE PRINT "GETFILE TROUBLE":STOP
22800 PRINT "The disk is clear of files by that name.":NOFILE=1:RESUME 22500
22850 '---------MAKFILE------opens a file for appending data----------------
22900 ON ERROR GOTO 23050' disk error subroutine DSKERROR
22950 OPEN FILESPEC$ FOR APPEND AS #1
23000 ON ERROR GOTO 0:RETURN
23050 IF ERR=24 THEN PRINT "No disk in drive? Device timeout.":GOTO 23600
23100 IF ERR=52 THEN PRINT "Bad file name. ";:INPUT "Try entering the complete filespec (with extension).";FILESPEC$:RESUME
23150 IF ERR=57 THEN PRINT "I/O error. Try another disk.":GOTO 23600
23200 IF ERR=61 THEN PRINT "Disk full. Try another disk.":GOTO 23600
23250 IF ERR=64 THEN PRINT "Bad file name. ";:INPUT "Try entering the complete filespec (with extension).";FILESPEC$:RESUME
23300 IF ERR=67 THEN PRINT "Too many files in directory. Try another disk to temoroarily save your data.":GOTO 23600
23350 IF ERR=68 THEN PRINT "Disk drive unavailable.":GOTO 23600
23400 IF ERR=70 THEN PRINT "You have write protected this disk!":GOTO 23600
23450 IF ERR=71 THEN PRINT "No disk in drive or door not closed.":GOTO 23600
23500 IF ERR=72 THEN PRINT "Disk Media Error. Try another disk.":GOTO 23600
23550 PRINT:PRINT "DISK PROBLEM ";:CLOSE:ON ERROR GOTO 0:END
23600 PRINT "Program will continue when problem is corrected.":LOCATE CSRLIN-2,1:RESUME
23650 '-----------DATCHECK----------input starting date---------------------
23700 Z1000$=DATE$'                                           --
23750 INPUT "date";DAT$'                                       | subroutine
23800 ON ERROR GOTO 24050'        Converts input                |    to
23850 DATE$=DAT$'                to standard                   |   enter
23900 ON ERROR GOTO 0'           date format (mm-dd-yyyy)      |    and
23950 DAT$=DATE$:DATE$=Z1000$'   and returns it as DAT$        |   check
24000 RETURN'                                                  |    the
24050 IF ERR=5 THEN 24100 ELSE PRINT "DATCHECK TROUBLE":STOP'   |   date
24100 PRINT "Not a valid date. Try again.":RESUME 23750'       --
24150 '---------------list a data file on the printer-----------------------
24200 ON ERROR GOTO 24350:LPRINT CHR$(27)CHR$(64)CHR$(14)CHR$(15)CHR$(27)CHR$(48)CHR$(27)CHR$(67)CHR$(0)CHR$(11)CHR$(27)CHR$(68)CHR$(20)CHR$(40)CHR$(60)CHR$(80)CHR$(100)CHR$(120)CHR$(0);:ON ERROR GOTO 0
24250 LPRINT "Listing of the file "FILESPEC$" on "DATE$" at "TIME$"."
24300 ON C GOTO 24400,24900,25400,25900,26400
24350 IF ERR=24 OR ERR=25 OR ERR=27 THEN BEEP:PRINT:PRINT "PRINTER NOT READY!...Program will resume when problem is corrected.":RESUME ELSE ON ERROR GOTO 0:GOTO 13350
24400 LPRINT:PAGE=PAGE+1:LPRINT CHR$(27)CHR$(45)CHR$(1)"---PAGE "PAGE"---"CHR$(9)"DATE"CHR$(9)"CLOSE"CHR$(9)"HIGH"CHR$(9)"LOW"CHR$(9)"VOLUME"CHR$(27)CHR$(45)CHR$(0)
24450 FOR N=1 TO 80
24500 IF EOF(1) THEN CLOSE #1:LPRINT CHR$(12):GOTO 13350
24550 INPUT #1, ATE$,VOL,HIGH,LOW,CLSE
24600 IF N/5=INT(N/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(1);
24650 IF (N-1)/5=INT((N-1)/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(0);
24700 LPRINT CHR$(9) ATE$ CHR$(9) CLSE CHR$(9) HIGH CHR$(9) LOW CHR$(9) VOL
24750 NEXT N
24800 LPRINT CHR$(12);
24850 GOTO 24200
24900 LPRINT:PAGE=PAGE+1:LPRINT CHR$(27)CHR$(45)CHR$(1)"---PAGE "PAGE"---"CHR$(9)"DATE"CHR$(9)"VOLUME"CHR$(9)"HIGH"CHR$(9)"LOW"CHR$(9)"CLOSE"CHR$(27)CHR$(45)CHR$(0)
24950 FOR N=1 TO 80
25000 IF EOF(1) THEN CLOSE #1:LPRINT CHR$(12):GOTO 13350
25050 INPUT #1, ATE$,VOL,HIGH,LOW,CLSE
25100 IF N/5=INT(N/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(1);
25150 IF (N-1)/5=INT((N-1)/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(0);
25200 LPRINT CHR$(9) ATE$ CHR$(9) VOL CHR$(9) HIGH CHR$(9) LOW CHR$(9) CLSE
25250 NEXT N
25300 LPRINT CHR$(12);
25350 GOTO 24200
25400 LPRINT:PAGE=PAGE+1:LPRINT CHR$(27)CHR$(45)CHR$(1)"---PAGE "PAGE"---"CHR$(9)"DATE"CHR$(9)"VOLUME"CHR$(9)"BID"CHR$(9)"ASKED"
25450 FOR N=1 TO 80
25500 IF EOF(1) THEN CLOSE #1:LPRINT CHR$(12):GOTO 13350
25550 INPUT #1, ATE$,VOL,BID,ASKED,DUMP
25600 IF N/5=INT(N/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(1);
25650 IF (N-1)/5=INT((N-1)/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(0);
25700 LPRINT CHR$(9) ATE$ CHR$(9) VOL CHR$(9) BID CHR$(9) ASKED
25750 NEXT N
25800 LPRINT CHR$(12);
25850 GOTO 24200
25900 LPRINT:PAGE=PAGE+1:LPRINT CHR$(27)CHR$(45)CHR$(1)"---PAGE "PAGE"---"CHR$(9)"DATE"CHR$(9)"CLOSE"CHR$(9)"CALL"CHR$(9)"PUT"
25950 FOR N=1 TO 80
26000 IF EOF(1) THEN CLOSE #1:LPRINT CHR$(12):GOTO 13350
26050 INPUT #1, ATE$,DUMP,CAL,PTT,CLSE
26100 IF N/5=INT(N/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(1);
26150 IF (N-1)/5=INT((N-1)/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(0);
26200 LPRINT CHR$(9) ATE$ CHR$(9) CLSE CHR$(9) CAL CHR$(9) PTT
26250 NEXT N
26300 LPRINT CHR$(12);
26350 GOTO 24200
26400 LPRINT:PAGE=PAGE+1:LPRINT CHR$(27)CHR$(45)CHR$(1)"---PAGE "PAGE"---"CHR$(9)"DATE"CHR$(9)"NET ASSET VALUE"CHR$(9)"OFFERING PRICE"
26450 FOR N=1 TO 80
26500 IF EOF(1) THEN CLOSE #1:LPRINT CHR$(12):GOTO 13350
26550 INPUT #1, ATE$,DUMP,NAV,OFFR,DUMP
26600 IF N/5=INT(N/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(1);
26650 IF (N-1)/5=INT((N-1)/5) THEN LPRINT CHR$(27)CHR$(45)CHR$(0);
26700 LPRINT CHR$(9) ATE$ CHR$(9) NAV CHR$(9) OFFR
26750 NEXT N
26800 LPRINT CHR$(12);
26850 GOTO 24200
26900 '----------------------------READ SEQUENCE FILE------------------------
26950 OPEN "UPDSTKFL.DAT" FOR INPUT AS #3
27000 IF EOF(3) THEN CLOSE #3:KEY ON:END
27050 LIN=CSRLIN:LOCATE 25,24:COLOR 0,7:PRINT STRING$(15," ");:COLOR 7,0:LOCATE LIN,1
27100 INPUT #3, FI$
27150 FILESPEC$=""
27200 FOR N=1 TO LEN(FI$):LTR$=MID$(FI$,N,1)
27250 IF "a"<=LTR$ AND LTR$<="z" THEN LTR$=CHR$(ASC(LTR$)-32)
27300 FILESPEC$=FILESPEC$+LTR$
27350 NEXT N
27400 SECTYPE$=RIGHT$(FILESPEC$,4)
27450 NAMELENGTH=INSTR(FILESPEC$,".")-1
27500 FILENAME$=LEFT$(FILESPEC$,NAMELENGTH)
27550 EXT$=SECTYPE$
27600 IF EXT$=".DJA" THEN C=1
27650 IF EXT$=".NYS" THEN C=2
27700 IF EXT$=".OTC" THEN C=3
27750 IF EXT$=".OPT" THEN C=4
27800 IF EXT$=".MUT" THEN C=5
27850 PRINT:PRINT SPC(24) FILESPEC$;
27900 OPEN FILESPEC$ FOR INPUT AS #1:GOTO 14000
27950 OPEN "MAKSTKFL.DOC" FOR INPUT AS #1 '-------------READ DOCUMENTATION-
28000 PRINT:PRINT:PRINT:PRINT
28050 FOR N=1 TO 20
28100 IF EOF(1) THEN CLOSE #1:ENDDOC=1:GOTO 28300
28150 LINE INPUT #1, DOCULINE$
28200 PRINT DOCULINE$
28250 NEXT N
28300 LIN=CSRLIN:LOCATE 25,1:COLOR 0,7:PRINT "Press any key to continue except <Esc>, which will end the program.";:COLOR 7,0:LOCATE LIN,1
28350 X$=INKEY$:IF X$="" THEN 28350 ELSE IF X$=CHR$(27) THEN 13350 ELSE 28400
28400 LIN=CSRLIN:LOCATE 25,1:COLOR 0,7:PRINT STRING$(79," ");:COLOR 7,0:LOCATE LIN,1
28450 IF ENDDOC THEN PRINT:PRINT "END OF DOCUMENTATION FILE":PRINT:PRINT:ENDDOC=0:GOTO 10500
28500 GOTO 28050 ' ---------------------end of read documentation--------------
28550 '----------------start of screen plotting routines--------------------
28600 LIN=CSRLIN:LOCATE 25,24:COLOR 0,7:PRINT FILESPEC$;:COLOR 7,0:LOCATE LIN,1
28650 GOSUB 34150' skipdays
28700 ON C GOTO 28800,28800,30950,34700,30950'
28750 '----------------------------------------------------C = 1 or 2--------
28800 MAXHIGH=0:MINLOW=65000!:SUMCLSE=0:DAYS=0
28850 PRINT:PRINT "--- DESCRIPTION OF THE PLOT TO FOLLOW --- ":PRINT
28900 PRINT:PRINT "The baseline, indicated by "CHR$(34)"A"CHR$(34)" is the average of the closing prices"
28950 PRINT "The daily high and low are indicated by "CHR$(34)"H"CHR$(34)" and "CHR$(34)"L"CHR$(34)" respectively."
29000 PRINT CHR$(34)"C"CHR$(34)" indicates the daily closing prices. This symbol overlays any "
29050 PRINT "other character that might otherwise be in its position.":PRINT
29100 IF EOF(1) THEN CLOSE #1:GOTO 29550' ------------determine scale--------
29150 INPUT #1,ENDDATE$,VOLUME,HIGH,LOW,CLSE
29200 IF HIGH=0 THEN 29300
29250 IF HIGH>MAXHIGH THEN MAXHIGH=HIGH
29300 IF LOW=0 THEN 29400
29350 IF LOW<MINLOW THEN MINLOW=LOW
29400 IF CLSE=0 THEN 29500
29450 SUMCLSE=SUMCLSE+CLSE:DAYS=DAYS+1
29500 GOTO 29100
29550 AVERAGE=SUMCLSE/DAYS
29600 RANGE=MAXHIGH-MINLOW
29650 MULTIPLIER=79/RANGE
29700 OFFSET=MINLOW*MULTIPLIER-1
29750 AV=INT(MULTIPLIER*AVERAGE-OFFSET)
29800 GOSUB 34400
29850 PRINT
29900 IF EOF(1) THEN CLOSE #1:GOTO 33050' ---------plot price data - C = 1 or 2
29950 INPUT #1, DAT$,VOL,HIGH,LOW,CLSE
30000 IF HIGH=0 THEN HI=AV:GOTO 30100
30050 HI=INT(MULTIPLIER*HIGH-OFFSET)
30100 IF CLSE=0 THEN CL=AV:GOTO 30200
30150 CL=INT(MULTIPLIER*CLSE-OFFSET)
30200 IF LOW=0  THEN LO=AV:GOTO 30400
30250 LO=INT(MULTIPLIER*LOW-OFFSET)
30300 IF LO<40 THEN TEXT=1
30350 IF HI>90 THEN TEXT=0
30400 FOR N=1 TO 80:GRAPH$(N)=" ":NEXT
30450 IF HIGH=0 AND LOW=0 AND CLSE=0 THEN GRAPH$(AV)="A":GOTO 30900
30500 FOR N=LO TO HI:GRAPH$(N)="#":NEXT
30550 IF HI<AV THEN FOR N=HI TO AV:GRAPH$(N)="-":NEXT
30600 IF AV<LO THEN FOR N=AV TO LO:GRAPH$(N)="-":NEXT
30650 GRAPH$(AV)="A"
30700 GRAPH$(LO)="L"
30750 GRAPH$(HI)="H"
30800 GRAPH$(CL)="C"
30850 IF EOF(1) THEN FOR N=1 TO 79:PRINT GRAPH$(N);:NEXT:GOTO 29900
30900 FOR N=1 TO 80:PRINT GRAPH$(N);:NEXT:GOTO 29900
30950 '----------------------------------------------------C = 3 or 5--------
31000 MINBID=65000!:MAXASK=0:SUMBID=0:DAYS=0
31050 PRINT:PRINT "In the plot to follow the average bid or net asset value over the range of"
31100 PRINT "days plotted forms the baseline, with values increasing to the right."
31150 IF EOF(1) THEN CLOSE #1:GOTO 31550' ------------determine scale-----------
31200 INPUT #1,ENDDATE$,VOLUME,BID,ASK,DUMP
31250 IF ASK=0 THEN 31350
31300 IF ASK>MAXASK THEN MAXASK=ASK
31350 IF BID=0 THEN 31150
31400 IF BID<MINBID THEN MINBID=BID
31450 SUMBID=SUMBID+BID:DAYS=DAYS+1
31500 GOTO 31150
31550 AVERAGE=SUMBID/DAYS
31600 RANGE=MAXASK-MINBID
31650 MULTIPLIER=79/RANGE
31700 OFFSET=MINBID*MULTIPLIER-1
31750 AV=INT(MULTIPLIER*AVERAGE-OFFSET)
31800 GOSUB 34400
31850 PRINT
31900 IF EOF(1) THEN CLOSE #1:GOTO 33050' ---------plot price data - C = 3 or 5
31950 INPUT #1, DAT$,VOL,BID,ASK,DUMP
32000 IF ASK=0 THEN AS=AV:GOTO 32100
32050 AS=INT(MULTIPLIER*ASK-OFFSET)
32100 IF BID=0  THEN BI=AV:GOTO 32300
32150 BI=INT(MULTIPLIER*BID-OFFSET)
32200 IF BI<40 THEN TEXT=1
32250 IF AS>90 THEN TEXT=0
32300 FOR N=1 TO 80:GRAPH$(N)=" ":NEXT
32350 IF ASK=0 AND BID=0 THEN GRAPH$(AV)="A":GOTO 32950
32400 FOR N=BI TO AS:GRAPH$(N)="#":NEXT
32450 IF AS<AV THEN FOR N=AS TO AV:GRAPH$(N)="-":NEXT
32500 IF AV<BI THEN FOR N=AV TO BI:GRAPH$(N)="-":NEXT
32550 GRAPH$(AV)="A"
32600 GRAPH$(BI)="L"
32650 GRAPH$(AS)="H"
32700 IF C=3 THEN GRAPH$(BI)="B"
32750 IF C=5 THEN GRAPH$(BI)="N"
32800 IF C=3 THEN GRAPH$(AS)="K"
32850 IF C=5 THEN GRAPH$(AS)="O"
32900 IF EOF(1) THEN FOR N=1 TO 79:PRINT GRAPH$(N);:NEXT:GOTO 31900
32950 FOR N=1 TO 80:PRINT GRAPH$(N);:NEXT:GOTO 31900
33000 '--------------------exit routine from price plotting------------------
33050 LIN=CSRLIN:LOCATE 25,39:COLOR 0,7:PRINT "PRESS A KEY TO CONT. OR <Esc> TO END";:COLOR 7,0:LOCATE LIN,1
33100 X$=INKEY$:IF X$="" THEN 33100 ELSE IF X$=CHR$(27) THEN 13350 ELSE 33200
33150 '-----------------------------PLOT VOLUME DATA-------------------------
33200 LIN=CSRLIN:LOCATE 25,39:COLOR 0,7:PRINT STRING$(40," ");:COLOR 7,0:LOCATE LIN,1
33250 ON C GOTO 33300,33300,33300,13350,13350
33300 GOSUB 34400
33350 INPUT #1, STARTDATE$,MAXVOL,HIGH,LOW,CLSE
33400 IF EOF(1) THEN CLOSE #1:GOTO 33600
33450 INPUT #1, ENDDATE$,VOL,HIGH,LOW,CLSE
33500 IF VOL>MAXVOL THEN MAXVOL=VOL
33550 GOTO 33400
33600 MULTIPLIER=79/MAXVOL
33650 GOSUB 34400
33700 PRINT
33750 IF EOF(1) THEN CLOSE #1:GOTO 38200
33800 INPUT #1, DAT$,VOL,HIGH,LOW,CLSE
33850 VL=INT(MULTIPLIER*VOL)
33900 FOR N=1 TO 80:GRAPH$(N)=" ":NEXT
33950 FOR N=1 TO VL:GRAPH$(N)="#":NEXT
34000 GRAPH$(VL)="V"
34050 IF EOF(1) THEN FOR N=1 TO 79:PRINT GRAPH$(N);:NEXT N:GOTO 33750
34100 FOR N=1 TO 80:PRINT GRAPH$(N);:NEXT N:GOTO 33750
34150 DAYSS=0'    ----------------------------------------skipdays start-------
34200 IF EOF(1) THEN CLOSE #1:GOTO 34350
34250 INPUT #1, DUMP$:FOR N=1 TO 4: INPUT #1, DUMP:NEXT
34300 DAYSS=DAYSS+1:GOTO 34200
34350 SKIP=DAYSS-24
34400 OPEN FILESPEC$ FOR INPUT AS #1' -----------skipdays after first pass----
34450 IF SKIP<=0 THEN RETURN
34500 FOR SK=1 TO SKIP
34550 INPUT #1, DUMP$:FOR N=1 TO 4:INPUT #1, DUMP:NEXT N
34600 NEXT SK
34650 RETURN'    ----------------------------------------skipdays end---------
34700 '----------------------------------OPTIONS----------- C = 4 ------------
34750 MAXCAL=0:MAXPTT=0:MAXL=0:MINCAL=65000!:MINPTT=65000!:MINL=65000!
34800 PRINT:PRINT "The following definitions apply to the plot that follows:":PRINT
34850 PRINT "P = PUT price":PRINT "C = CALL price":PRINT "U = closing price of the underlying stock":PRINT "L = U - C":PRINT "T = U + P":PRINT "S = strike price":PRINT
34900 IF EOF(1) THEN CLOSE #1:GOTO 35550' -----------determine scale--------
34950 INPUT #1,ENDDATE$,DUMP,CAL,PTT,CLSE
35000 IF CAL=0 THEN 35150
35050 IF CAL>MAXCAL THEN MAXCAL=CAL
35100 IF CAL<MINCAL THEN MINCAL=CAL
35150 IF PTT=0 THEN 35300
35200 IF PTT<MINPTT THEN MINPTT=PTT
35250 IF PTT>MAXPTT THEN MAXPTT=PTT
35300 IF CLSE=0 THEN 35500
35350 LLL=CLSE-CAL:TTT=CLSE+PTT
35400 IF LLL<MINL THEN MINL=LLL
35450 IF TTT>MAXT THEN MAXT=TTT
35500 GOTO 34900
35550 RANGECAL=MAXCAL-MINCAL
35600 RANGEPTT=MAXPTT-MINPTT
35650 RANGEUUU=MAXT-MINL
35700 MULTIPLCAL=75/RANGECAL
35750 MULTIPLPTT=75/RANGEPTT
35800 MULTIPLUUU=75/RANGEUUU
35850 OFFCAL=MINCAL*MULTIPLCAL-2
35900 OFFPTT=MINPTT*MULTIPLPTT-2
35950 OFFUUU=MINL*MULTIPLUUU-2
36000 STRIKE=VAL(RIGHT$(FILENAME$,2))
36050 ST=INT(MULTIPLUUU*STRIKE-OFFUUU)
36100 GOSUB 34400
36150 CL=INT(MULTIPLUUU*CLSE-OFFUUU)
36200 CA=INT(MULTIPLCAL*CAL-OFFCAL)
36250 LLL=CLSE-CAL
36300 LL=INT(MULTIPLUUU*LLL-OFFUUU)
36350 PT=INT(MULTIPLPTT*PTT-OFFPTT)
36400 TTT=CLSE+PTT
36450 TT=INT(MULTIPLUUU*TTT-OFFUUU)
36500 IF EOF(1) THEN 38200' ---------plot price data - C = 4 OPTIONS---------
36550 INPUT #1, DAT$,DUMP,CAL,PTT,CLSE
36600 IF CLSE=0 THEN 36700
36650 CL=INT(MULTIPLUUU*CLSE-OFFUUU)
36700 IF CAL=0 THEN 36950
36750 CA=INT(MULTIPLCAL*CAL-OFFCAL)
36800 IF CLSE=0 THEN 36950
36850 LLL=CLSE-CAL
36900 LL=INT(MULTIPLUUU*LLL-OFFUUU)
36950 IF PTT=0 THEN 37250
37000 LLL=CLSE-CAL
37050 PT=INT(MULTIPLPTT*PTT-OFFPTT)
37100 IF CLSE=0 THEN 37250
37150 TTT=CLSE+PTT
37200 TT=INT(MULTIPLUUU*TTT-OFFUUU)
37250 FOR N=1 TO 80:GRAPH$(N)=" ":NEXT N
37300 IF CAL=0 AND PTT=0 AND CLSE=0 THEN PRINT:GOTO 36500
37350 IF CAL=0 THEN 37450
37400 FOR N= LL TO CL:GRAPH$(N)="-":NEXT
37450 IF PTT=0 THEN 37550
37500 FOR N= CL TO TT:GRAPH$(N)="+":NEXT
37550 GRAPH$(ST)="S"
37600 IF PTT=0 THEN 37700
37650 GRAPH$(TT)="T"
37700 IF CAL=0 THEN 37800
37750 GRAPH$(LL)="L"
37800 GRAPH$(CL)="U"
37850 IF PTT=0 THEN 37950
37900 GRAPH$(PT-1)="#":GRAPH$(PT)="P":GRAPH$(PT+1)="#"
37950 IF CAL=0 THEN 38050
38000 GRAPH$(CA-1)="#":GRAPH$(CA)="C":GRAPH$(CA+1)="#"
38050 GRAPH$(0)=CHR$(156)
38100 FOR N=1 TO 80:PRINT GRAPH$(N);:NEXT N
38150 GOTO 36500
38200 LIN=CSRLIN:LOCATE 25,39:COLOR 0,7:PRINT "PRESS <Esc> TO END";:COLOR 7,0:LOCATE LIN,1
38250 X$=INKEY$:IF X$="" THEN 38200 ELSE IF X$=CHR$(27) THEN 13350 ELSE 38200
38300 '           SAVE"makstkfl.bas",a
65000 '           SAVE"makstkfl.bas",a
